
import fetch from '../../utils/http/fetch.js'
import consts from '../../utils/http/consts.js'

const ROOT = './cs/ad';

export default {
  login(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/login`);
  },
  get(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/myself`);
  },
  list(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/list`);
  },
  new(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/new`);
  },
  update(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/update`);
  },
  page(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/page`);
  },
  delete(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/delete`);
  },
  saveList(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/save-list`);
  },
  sort(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/sort`);
  },
  saveMenu(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/menu`);  // 保存勾选菜单
  },
}
